class Solution {
    public int lengthOfLIS(int[] nums) {
        int len = nums.length;
        int db[] = new int[len];
        int max = 0;
        for (int i = 0; i < len; i++) {
            int atNum = 1;
            for (int j = 0; j < i; j++) {
                if (nums[j] < nums[i]) {
                    atNum = db[j] >= atNum ? db[j] + 1 : atNum;
                }
            }
            db[i] = atNum;
            max = max < atNum ? atNum : max;
        }
        return max;
    }
}